import cv2
import numpy as np
import matplotlib.pyplot as plt

# 读取图像
image = cv2.imread('Aaron_Eckhart_0001.jpg')

# 定义高斯模糊的核大小
kernel_sizes = [(3, 3), (5, 5), (7, 7), (9, 9), (11, 11)]
accuracies = [0.9898, 0.9868, 0.9821, 0.9774, 0.9656]

# 绘制折线图
fig, ax = plt.subplots(figsize=(10, 6))

# 绘制每个高斯模糊核大小下的准确度
ax.plot([str(k) for k in kernel_sizes], accuracies, marker='o', label="Accuracy")

ax.set_xlabel("Kernel Size")
ax.set_ylabel("Accuracy")
ax.set_title("Accuracy under different Gaussian blur kernel sizes")
ax.set_xticks([str(k) for k in kernel_sizes])
ax.legend()

plt.tight_layout()
plt.savefig("gaussian_blur_accuracy_line.png")
plt.show()

